home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7300 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  1.9 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 6c 6f | 63 75 74 75 73 2e 72 63 |Path: lo|cutus.rc|
|00000010| 68 6c 61 6e 64 2e 69 62 | 6d 2e 63 6f 6d 21 75 73 |hland.ib|m.com!us|
|00000020| 65 6e 65 74 0a 46 72 6f | 6d 3a 20 50 68 69 6c 69 |enet.Fro|m: Phili|
|00000030| 70 20 53 74 61 69 74 65 | 20 3c 70 73 74 61 69 74 |p Staite| <pstait|
|00000040| 65 2b 40 72 63 68 6c 61 | 6e 64 2e 69 62 6d 2e 63 |e+@rchla|nd.ibm.c|
|00000050| 6f 6d 3e 0a 4e 65 77 73 | 67 72 6f 75 70 73 3a 20 |om>.News|groups: |
|00000060| 63 6f 6d 70 2e 6c 61 6e | 67 2e 63 2b 2b 0a 53 75 |comp.lan|g.c++.Su|
|00000070| 62 6a 65 63 74 3a 20 52 | 65 3a 20 41 20 73 69 6d |bject: R|e: A sim|
|00000080| 70 6c 65 20 22 66 69 6e | 64 20 74 68 65 20 62 75 |ple "fin|d the bu|
|00000090| 67 22 20 28 70 6c 65 61 | 73 65 21 20 49 20 6e 65 |g" (plea|se! I ne|
|000000a0| 65 64 20 68 65 6c 70 20 | 3a 29 0a 44 61 74 65 3a |ed help |:).Date:|
|000000b0| 20 54 68 75 2c 20 32 32 | 20 46 65 62 20 31 39 39 | Thu, 22| Feb 199|
|000000c0| 36 20 30 36 3a 35 33 3a | 31 34 20 2d 30 36 30 30 |6 06:53:|14 -0600|
|000000d0| 0a 4f 72 67 61 6e 69 7a | 61 74 69 6f 6e 3a 20 49 |.Organiz|ation: I|
|000000e0| 42 4d 20 52 6f 63 68 65 | 73 74 65 72 2c 20 4d 4e |BM Roche|ster, MN|
|000000f0| 0a 4d 65 73 73 61 67 65 | 2d 49 44 3a 20 3c 33 31 |.Message|-ID: <31|
|00000100| 32 43 36 37 33 41 2e 31 | 35 46 42 40 72 63 68 6c |2C673A.1|5FB@rchl|
|00000110| 61 6e 64 2e 69 62 6d 2e | 63 6f 6d 3e 0a 52 65 66 |and.ibm.|com>.Ref|
|00000120| 65 72 65 6e 63 65 73 3a | 20 3c 34 67 64 72 36 6e |erences:| <4gdr6n|
|00000130| 24 36 70 30 40 67 75 61 | 76 61 2e 65 70 69 78 2e |$6p0@gua|va.epix.|
|00000140| 6e 65 74 3e 0a 4e 4e 54 | 50 2d 50 6f 73 74 69 6e |net>.NNT|P-Postin|
|00000150| 67 2d 48 6f 73 74 3a 20 | 70 6f 77 65 72 74 6f 6f |g-Host: |powertoo|
|00000160| 6c 2e 72 63 68 6c 61 6e | 64 2e 69 62 6d 2e 63 6f |l.rchlan|d.ibm.co|
|00000170| 6d 0a 4d 69 6d 65 2d 56 | 65 72 73 69 6f 6e 3a 20 |m.Mime-V|ersion: |
|00000180| 31 2e 30 0a 43 6f 6e 74 | 65 6e 74 2d 54 79 70 65 |1.0.Cont|ent-Type|
|00000190| 3a 20 74 65 78 74 2f 70 | 6c 61 69 6e 3b 20 63 68 |: text/p|lain; ch|
|000001a0| 61 72 73 65 74 3d 75 73 | 2d 61 73 63 69 69 0a 43 |arset=us|-ascii.C|
|000001b0| 6f 6e 74 65 6e 74 2d 54 | 72 61 6e 73 66 65 72 2d |ontent-T|ransfer-|
|000001c0| 45 6e 63 6f 64 69 6e 67 | 3a 20 37 62 69 74 0a 58 |Encoding|: 7bit.X|
|000001d0| 2d 4d 61 69 6c 65 72 3a | 20 4d 6f 7a 69 6c 6c 61 |-Mailer:| Mozilla|
|000001e0| 20 32 2e 30 20 28 58 31 | 31 3b 20 49 3b 20 41 49 | 2.0 (X1|1; I; AI|
|000001f0| 58 20 31 29 0a 54 6f 3a | 20 4a 6f 6e 20 3c 6a 67 |X 1).To:| Jon <jg|
|00000200| 76 64 40 65 70 69 78 2e | 6e 65 74 3e 0a 0a 4a 6f |vd@epix.|net>..Jo|
|00000210| 6e 20 77 72 6f 74 65 3a | 0a 3e 20 0a 3e 20 49 20 |n wrote:|.> .> I |
|00000220| 77 72 6f 74 65 20 74 68 | 69 73 20 6a 75 73 74 20 |wrote th|is just |
|00000230| 6e 6f 77 20 61 6e 64 20 | 69 74 27 73 20 74 65 6c |now and |it's tel|
|00000240| 6c 69 6e 67 20 6d 65 20 | 74 68 61 74 20 77 68 65 |ling me |that whe|
|00000250| 6e 20 69 20 74 72 79 20 | 74 6f 20 63 6f 75 74 20 |n i try |to cout |
|00000260| 74 68 65 0a 3e 20 72 65 | 73 75 6c 74 20 61 74 20 |the.> re|sult at |
|00000270| 74 68 65 20 62 6f 74 74 | 6f 6d 2c 20 69 74 20 69 |the bott|om, it i|
|00000280| 73 20 61 6e 20 75 6e 64 | 65 66 69 6e 65 64 20 76 |s an und|efined v|
|00000290| 61 6c 75 65 20 65 76 65 | 6e 20 74 68 6f 75 67 68 |alue eve|n though|
|000002a0| 20 49 20 64 69 64 20 72 | 65 74 75 72 6e 0a 3e 20 | I did r|eturn.> |
|000002b0| 74 68 65 20 72 65 73 75 | 6c 74 20 76 61 72 2e 2e |the resu|lt var..|
|000002c0| 2e 20 20 53 65 65 20 69 | 66 20 79 6f 75 20 63 61 |. See i|f you ca|
|000002d0| 6e 20 68 65 6c 70 2e 0a | 3e 20 0a 3e 20 23 69 6e |n help..|> .> #in|
|000002e0| 63 6c 75 64 65 20 3c 69 | 6f 73 74 72 65 61 6d 2e |clude <i|ostream.|
|000002f0| 68 3e 0a 3e 20 0a 3e 20 | 66 6c 6f 61 74 20 6e 75 |h>.> .> |float nu|
|00000300| 6d 31 3b 0a 3e 20 66 6c | 6f 61 74 20 6e 75 6d 32 |m1;.> fl|oat num2|
|00000310| 3b 0a 3e 20 0a 3e 20 67 | 65 74 6e 75 6d 73 20 28 |;.> .> g|etnums (|
|00000320| 29 20 7b 0a 20 0a 42 79 | 20 64 65 66 61 75 6c 74 |) {. .By| default|
|00000330| 20 74 68 65 20 63 6f 6d | 70 69 6c 65 72 20 69 73 | the com|piler is|
|00000340| 20 67 6f 69 6e 67 20 74 | 6f 20 74 68 69 6e 6b 20 | going t|o think |
|00000350| 67 65 74 6e 75 6d 73 28 | 29 20 72 65 74 75 72 6e |getnums(|) return|
|00000360| 73 20 61 6e 20 69 6e 74 | 2e 0a 41 70 70 61 72 65 |s an int|..Appare|
|00000370| 6e 74 6c 79 20 79 6f 75 | 20 77 61 6e 74 20 74 6f |ntly you| want to|
|00000380| 20 72 65 74 75 72 6e 20 | 61 20 66 6c 6f 61 74 20 | return |a float |
|00000390| 73 6f 20 79 6f 75 20 6e | 65 65 64 20 74 6f 20 64 |so you n|eed to d|
|000003a0| 65 63 6c 61 72 65 2f 64 | 65 66 69 6e 65 20 69 74 |eclare/d|efine it|
|000003b0| 0a 61 73 3a 0a 0a 66 6c | 6f 61 74 20 67 65 74 6e |.as:..fl|oat getn|
|000003c0| 75 6d 73 28 29 20 7b 0a | 0a 0a 3e 20 66 6c 6f 61 |ums() {.|..> floa|
|000003d0| 74 20 72 65 73 75 6c 74 | 20 3d 20 6e 75 6d 31 20 |t result| = num1 |
|000003e0| 2b 6e 75 6d 32 3b 0a 0a | 59 6f 75 20 64 6f 6e 27 |+num2;..|You don'|
|000003f0| 74 20 77 61 6e 74 20 74 | 6f 20 70 65 72 66 6f 72 |t want t|o perfor|
|00000400| 6d 20 74 68 69 73 20 63 | 61 6c 63 75 6c 61 74 69 |m this c|alculati|
|00000410| 6f 6e 20 62 65 66 6f 72 | 65 20 79 6f 75 27 76 65 |on befor|e you've|
|00000420| 20 72 65 61 64 20 69 6e | 20 74 68 65 0a 6e 75 6d | read in| the.num|
|00000430| 62 65 72 73 20 66 6f 72 | 20 6e 75 6d 31 20 61 6e |bers for| num1 an|
|00000440| 64 20 6e 75 6d 32 2c 20 | 64 6f 20 79 6f 75 3f 20 |d num2, |do you? |
|00000450| 20 4d 6f 76 65 20 74 68 | 69 73 20 6c 69 6e 65 20 | Move th|is line |
|00000460| 64 6f 77 6e 20 73 6f 6d | 65 2e 2e 2e 0a 0a 3e 20 |down som|e.....> |
|00000470| 0a 3e 20 63 6f 75 74 20 | 3c 3c 20 22 57 68 61 74 |.> cout |<< "What|
|00000480| 20 6e 75 6d 62 65 72 3f | 5c 6e 22 3b 0a 3e 20 63 | number?|\n";.> c|
|00000490| 69 6e 20 3e 3e 20 6e 75 | 6d 31 3b 0a 3e 20 63 6f |in >> nu|m1;.> co|
|000004a0| 75 74 20 3c 3c 20 22 41 | 6e 64 3f 5c 6e 22 3b 0a |ut << "A|nd?\n";.|
|000004b0| 3e 20 63 69 6e 20 3e 3e | 20 6e 75 6d 32 3b 0a 0a |> cin >>| num2;..|
|000004c0| 20 20 20 20 66 6c 6f 61 | 74 20 72 65 73 75 6c 74 | floa|t result|
|000004d0| 20 3d 20 6e 75 6d 31 20 | 2b 20 6e 75 6d 32 3b 0a | = num1 |+ num2;.|
|000004e0| 0a 3e 20 0a 3e 20 72 65 | 74 75 72 6e 20 72 65 73 |.> .> re|turn res|
|000004f0| 75 6c 74 3b 0a 3e 20 7d | 0a 3e 20 0a 3e 20 6d 61 |ult;.> }|.> .> ma|
|00000500| 69 6e 20 28 29 7b 0a 3e | 20 0a 3e 20 67 65 74 6e |in (){.>| .> getn|
|00000510| 75 6d 73 20 28 29 3b 0a | 0a 4e 6f 77 2c 20 79 6f |ums ();.|.Now, yo|
|00000520| 75 20 6e 65 65 64 20 74 | 6f 20 22 63 61 74 63 68 |u need t|o "catch|
|00000530| 22 20 74 68 65 20 72 65 | 74 75 72 6e 20 76 61 6c |" the re|turn val|
|00000540| 75 65 20 66 72 6f 6d 20 | 67 65 74 6e 75 6d 73 20 |ue from |getnums |
|00000550| 69 6e 20 61 20 76 61 72 | 69 61 62 6c 65 2c 0a 6c |in a var|iable,.l|
|00000560| 6f 6f 6b 73 20 6c 69 6b | 65 20 79 6f 75 20 77 61 |ooks lik|e you wa|
|00000570| 6e 74 20 74 6f 20 63 61 | 6c 6c 20 69 74 20 72 65 |nt to ca|ll it re|
|00000580| 73 75 6c 74 2e 20 20 4e | 6f 74 65 2c 20 75 73 69 |sult. N|ote, usi|
|00000590| 6e 67 20 74 68 65 20 73 | 61 6d 65 20 6e 61 6d 65 |ng the s|ame name|
|000005a0| 0a 74 68 72 6f 75 67 68 | 6f 75 74 20 63 61 6e 20 |.through|out can |
|000005b0| 62 6f 74 68 20 68 65 6c | 70 20 61 6e 64 20 68 75 |both hel|p and hu|
|000005c0| 72 74 2e 20 20 48 65 6c | 70 73 20 69 6e 20 6b 65 |rt. Hel|ps in ke|
|000005d0| 65 70 69 6e 67 20 74 68 | 69 6e 67 73 20 63 6f 6e |eping th|ings con|
|000005e0| 73 69 73 74 65 6e 74 2c | 0a 68 75 72 74 73 20 69 |sistent,|.hurts i|
|000005f0| 6e 20 69 74 20 69 73 20 | 68 61 72 64 20 74 6f 20 |n it is |hard to |
|00000600| 74 65 6c 6c 20 77 68 69 | 63 68 20 76 61 72 69 61 |tell whi|ch varia|
|00000610| 62 6c 65 20 69 73 20 69 | 6e 20 73 63 6f 70 65 2e |ble is i|n scope.|
|00000620| 2e 2e 0a 0a 20 20 20 66 | 6c 6f 61 74 20 72 65 73 |.... f|loat res|
|00000630| 75 6c 74 20 3d 20 67 65 | 74 6e 75 6d 73 28 29 3b |ult = ge|tnums();|
|00000640| 0a 0a 3e 20 0a 3e 20 63 | 6f 75 74 20 3c 3c 20 72 |..> .> c|out << r|
|00000650| 65 73 75 6c 74 3b 0a 3e | 20 7d 0a 3e 20 0a 3e 20 |esult;.>| }.> .> |
|00000660| 20 20 20 20 20 20 20 20 | 5e 5e 5e 5e 5e 5e 20 72 | |^^^^^^ r|
|00000670| 69 67 68 74 20 74 68 65 | 72 65 20 69 73 20 74 68 |ight the|re is th|
|00000680| 65 20 72 65 73 75 6c 74 | 20 69 20 77 61 6e 74 20 |e result| i want |
|00000690| 70 72 69 6e 74 65 64 20 | 62 75 74 20 69 74 20 64 |printed |but it d|
|000006a0| 6f 65 73 20 6e 6f 74 0a | 3e 20 72 65 63 6f 67 6e |oes not.|> recogn|
|000006b0| 69 7a 65 20 69 74 20 65 | 76 65 6e 20 74 68 6f 75 |ize it e|ven thou|
|000006c0| 67 68 20 49 20 64 69 64 | 20 74 72 79 20 74 6f 20 |gh I did| try to |
|000006d0| 72 65 74 75 72 6e 20 74 | 68 65 20 76 61 6c 75 65 |return t|he value|
|000006e0| 20 69 6e 20 74 68 65 20 | 66 75 6e 63 74 69 6f 6e | in the |function|
|000006f0| 0a 3e 20 67 65 74 6e 75 | 6d 73 2e 2e 2e 20 61 6d |.> getnu|ms... am|
|00000700| 20 49 20 6d 69 73 73 69 | 6e 67 20 73 6f 6d 65 74 | I missi|ng somet|
|00000710| 68 69 6e 67 3f 0a 3e 20 | 0a 3e 20 4a 6f 6e 0a 0a |hing?.> |.> Jon..|
|00000720| 2d 2d 20 0a 0a 50 68 69 | 6c 20 53 74 61 69 74 65 |-- ..Phi|l Staite|
|00000730| 2c 20 28 35 30 37 29 20 | 32 35 33 2d 32 35 32 39 |, (507) |253-2529|
|00000740| 2c 20 74 65 61 6d 20 4f | 53 2f 32 0a 69 6e 74 65 |, team O|S/2.inte|
|00000750| 72 6e 65 74 3a 20 70 73 | 74 61 69 74 65 40 76 6e |rnet: ps|taite@vn|
|00000760| 65 74 2e 69 62 6d 2e 63 | 6f 6d 20 20 69 6e 74 65 |et.ibm.c|om inte|
|00000770| 72 6e 61 6c 3a 20 70 73 | 74 61 69 74 65 40 72 63 |rnal: ps|taite@rc|
|00000780| 68 6c 61 6e 64 0a | |hland. | |
+--------+-------------------------+-------------------------+--------+--------+